package com.piggy.logi.sys.api.factory;

import com.piggy.common.core.domain.R;
import com.piggy.common.core.web.page.TableDataInfo;
import com.piggy.logi.sys.api.RemoteLogiMenuService;
import com.piggy.logi.sys.api.RemoteLogiPricePlanService;
import com.piggy.logi.sys.api.bo.LogiPricePlanExtEditBo;
import com.piggy.logi.sys.api.bo.LogiPricePlanQueryBo;
import com.piggy.logi.sys.api.bo.LogiSysMenuBo;
import com.piggy.logi.sys.api.vo.LogiPricePlanExtVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 菜单服务降级处理
 *
 * @author shark
 */
@Component
public class RemoteLogiPricePlanFallbackFactory implements FallbackFactory<RemoteLogiPricePlanService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteLogiPricePlanFallbackFactory.class);

    @Override
    public RemoteLogiPricePlanService create(Throwable throwable) {
        log.error("菜单服务调用失败:{}", throwable.getMessage());
        return new RemoteLogiPricePlanService()
        {
            @Override
            public TableDataInfo<LogiPricePlanExtVo> innerList(LogiPricePlanQueryBo bo, String source) {
                return null;
            }

            @Override
            public R<List<LogiPricePlanExtVo>> queryInnerList(LogiPricePlanQueryBo bo, String source) {
                return null;
            }

            @Override
            public R<LogiPricePlanExtVo> innerInfo(Long id, String source) {
                return null;
            }

            @Override
            public R<LogiPricePlanExtVo> innerAdd(LogiPricePlanExtEditBo bo, String source) {
                return null;
            }

            @Override
            public R<LogiPricePlanExtVo> innerEdit(LogiPricePlanExtEditBo bo, String source) {
                return null;
            }

            @Override
            public R<Integer> innerRemove(@NotEmpty(message = "主键不能为空") Long[] ids, String source) {
                return null;
            }
        };
    }
}
